package cn.wolfcode.service.impl;

import cn.wolfcode.domain.Rank;
import cn.wolfcode.mapper.RankMapper;
import cn.wolfcode.query.RankQuery;
import cn.wolfcode.service.IRankService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
* 排行服务接口实现
*/
@Service
@Transactional
public class RankServiceImpl extends ServiceImpl<RankMapper, Rank> implements IRankService {

    @Override
    public IPage<Rank> queryPage(RankQuery qo) {
        IPage<Rank> page = new Page<>(qo.getCurrentPage(), qo.getPageSize());
        QueryWrapper<Rank> wrapper = Wrappers.<Rank>query();
        return super.page(page, wrapper);
    }
}
